New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

duplitect

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duplitect

Package Duplicate Detector

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
207
increased by10.11%
Maintainers
1
Weekly downloads
 
Created
Source

duplitect

travis npm

duplitect is a simple tool to detect duplicate versions of installed packages. JavaScript package managers such as NPM and Yarn habitually allow you to install multiple versions of (transient) dependencies. This works most of the time - for certain kinds of packages, it does not.

untool happens to be among these packages that have to be installed exactly once inside any given project, which is why we built this module.

Installation

Using NPM:

npm install -S duplitect

Using Yarn:

yarn add duplitect

CLI

Usually, you will want to use duplitect as a CLI tool. Since most typical Node.js projects contain a significant number of (unproblematic) duplicates, you will probably want to limit duplitect's output by passing one or more patterns.

Example
$ duplitect untool @untool*
Duplicate: untool
Duplicate: @untool/core

duplitect supports the wildcard character * as shown above. This allows you to match multiple, possibly scoped, packages at once.

API

getDuplicates(cwd, [pattern, pattern, ...])

You can also use duplitect in your own tools - it only exposes a single function that mimics the CLI functionality. It returns a Promise object that resolves to an array of strings identifying duplicate packages.

Example
const getDuplicates = require('duplitect');

getDuplicates(process.cwd(), 'untool', '@untool*').then(duplicates => {
  duplicates.forEach(duplicate => console.log(`Duplicate: duplicate`));
});

FAQs

Package last updated on 21 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc